package com.zl.cms.model;

import javax.persistence.*;

/**
 * User: zl email:c3tc3tc3t@126.com Date: 14-1-13 Time: 下午4:42 用户组对象，使用该对象来获取可以发布文章的栏目信息
 */
//@Entity
//@Table(name = "t_group")
public class Group {
  /**
   * 组id
   */
  private int id;
  /**
   * 组名称，英文
   */
  private String name;
  /**
   * 组描述
   */
  private String descr;


  public Group() {}

  public Group(int id, String name, String descr) {
    this.id = id;
    this.name = name;
    this.descr = descr;
  }

  public Group(String name, String descr) {
    this.name = name;
    this.descr = descr;
  }

  @Override
  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;

    Group group = (Group) o;

    if (id != group.getId()) return false;
    if (!name.equals(group.getName())) return false;

    return true;
  }

  @Override
  public int hashCode() {
    int result = id;
    result = 31 * result + name.hashCode();
    return result;
  }

  @Override
  public String toString() {
    return "Group{" + "id=" + id + ", name='" + name + '\'' + ", describe='" + descr + '\''
        + '}';
  }

  //@Id
  //@GeneratedValue(strategy = GenerationType.IDENTITY)
  public int getId() {
    return id;
  }

  public void setId(int id) {
    this.id = id;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public String getDescr() {
    return descr;
  }

  public void setDescr(String descr) {
    this.descr = descr;
  }
}
